//
//  UIImage+IJBundle.m
//  IJLoginSDK
//
//  Created by yafei liu on 2021/4/12.
//

#import "UIImage+IJBundle.h"
#import "NSBundle+IJLoginSDK.h"

@implementation UIImage (IJBundle)

+ (nullable UIImage *)ij_imageNamedInLoginBundle:(NSString *)name {
//    NSString *bundlePath  = [[NSBundle mainBundle] pathForResource:@"BusinessUCBundle" ofType: @"bundle"];
    NSBundle *bundle =[NSBundle ij_IJLoginSDKBundle];
    UIImage *image = [UIImage ij_imageNamed:name inBundle:bundle];
    if (image == nil) {
//        [BGBaseKitManager bg_logWithFormat:@"CUICatalog: Invalid asset name supplied:%@",name];
    }
    
    return image;
}

+ (nullable UIImage *)ij_imageNamed:(NSString *)name inBundle:(nullable NSBundle *)bundle {
    return [UIImage ij_imageNamed:name inBundle:bundle compatibleWithTraitCollection:nil];
}

+ (nullable UIImage *)ij_imageNamed:(NSString *)name inBundle:(nullable NSBundle *)bundle compatibleWithTraitCollection:(nullable UITraitCollection *)traitCollection {
    return [UIImage imageNamed:name inBundle:bundle compatibleWithTraitCollection:traitCollection];
}

@end
